using System;
#if !NETFX_CORE

#endif

namespace Mvvm.Native.ActionInvoker {
    public class StrongReferenceActionInvokerFactory : IActionInvokerFactory {
        IActionInvoker IActionInvokerFactory.CreateActionInvoker<TMessage>(object recipient, Action<TMessage> action) {
            return new StrongReferenceActionInvoker<TMessage>(recipient, action);
        }
    }
    public class WeakReferenceActionInvokerFactory : IActionInvokerFactory {
        IActionInvoker IActionInvokerFactory.CreateActionInvoker<TMessage>(object recipient, Action<TMessage> action) {
#if !NETFX_CORE
            if(action.Method.IsStatic)
#else
            if(action.GetMethodInfo().IsStatic)
#endif
                return new StrongReferenceActionInvoker<TMessage>(recipient, action);
            return new WeakReferenceActionInvoker<TMessage>(recipient, action);
        }
    }
}